//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System.Web.UI.WebControls;
using CommunityServer.Components;

namespace CommunityServer.Controls
{
	public class AccountStatusDropDownList : DropDownList
	{
		public AccountStatusDropDownList()
		{
			// Add countries
			//

		}

		public override void DataBind()
		{
			base.DataBind ();

			if(!Page.IsPostBack)
			{
				if (EnableShowAll)
					Items.Add(new ListItem(ResourceManager.GetString("AccountStatus_NotFiltered"), ((int) UserAccountStatus.All).ToString()));
		
				Items.Add(new ListItem(ResourceManager.GetString("AccountStatus_Approved"), ((int) UserAccountStatus.Approved).ToString()));
				Items.Add(new ListItem(ResourceManager.GetString("AccountStatus_ApprovalPending"), ((int) UserAccountStatus.ApprovalPending).ToString()));
				Items.Add(new ListItem(ResourceManager.GetString("AccountStatus_Banned"), ((int) UserAccountStatus.Banned).ToString()));
				Items.Add(new ListItem(ResourceManager.GetString("AccountStatus_Disapproved"), ((int) UserAccountStatus.Disapproved).ToString()));
			}
		}


		public new UserAccountStatus SelectedValue
		{
			get { return (UserAccountStatus) int.Parse(base.SelectedValue); }
			set { base.SelectedValue = ((int) value).ToString(); }
		}

		private bool _enableShowAll;

		public bool EnableShowAll
		{
			get { return _enableShowAll; }
			set { _enableShowAll = value; }
		}

	}
}